var TabWidget = (function(){
	var tab_container = false;
	var section_content = false;
	var nav_bar = false;
	
	return {
		init : function(container, content, nav){
			tab_container = container;
			section_content = tab_container + " > " + content;
			nav_bar = tab_container + " " + nav;
			var that = this;
			var actions = nav_bar + ' a';
			var current = nav_bar + ' li.current a';

			$j(actions).click(function(){
				that.loadContent($j(this),false);
				return false;
			});

			
			this.loadContent($j(current),false);
			
		},
		destroy : function(){
		},
		loadContent : function(tab, params){
			$j(nav_bar + ' a').removeClass('selected'); //remuevo la clase selected
            tab.addClass('selected'); //adhiero la clase selected a mi link
            $j(section_content).load(tab.attr("href"));
		}
		
	};	

	
}());